<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
          name="viewport">
    <meta content="ie=edge" http-equiv="X-UA-Compatible">
    <title>Document</title>

</head>
<body>
<input id="num1" name="" type="text">
<input id="num2" name="" type="text">
<button onclick="fn()">点击生成两个数之间的数字组成的奇数</button>
<div id="root">

</div>
<script>
    function fn() {
        let num1 = document.getElementById('num1').value
        let num2 = document.getElementById('num2').value
        let result = 0
        if (num1 > num2) [num1, num2] = [num2, num1];
        for (let i = num1; i <= num2; i++) {
            for (let j = num1; j <= num2; j++) {
                if (i === j) continue;
                if (('' + i + j) % 2 === 1) {
                    root.innerHTML += '' + i + j + '&emsp;';
                    result++
                }
            }

        }
        root.innerHTML += '</br>';
        root.innerHTML += '一共' + result + '个奇数'
    }
</script>

</body>
</html>